package com.itheima_6;

import java.util.HashSet;

public class HashSetDemo01 {

    public static void main(String[] args) {
        HashSet<Student> hashSet = new HashSet<Student>();

        Student s1 = new Student("杭三","29");
        Student s2 = new Student("李四","29");
        Student s3 = new Student("王武","29");
        Student s4 = new Student("杭三","29");

        hashSet.add(s1);
        hashSet.add(s2);
        hashSet.add(s3);
        hashSet.add(s4);

        for (Student s : hashSet) {
            System.out.println(s.getName()+","+s.getAge());
        }

    }
}
